﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Minestorm.Retro.Entities
{
    public class MagneticMine : Mine
    {
        public MagneticMine(GraphicsDevice graphics, MineSize mineSize, Vector2 position, float angle)
            : base(graphics, mineSize, position)
        {
            MineType = GameLogic.MineType.Magnetic;
            Angle = angle;
            Speed = Constants.Mine.Enemy_Speed;
            IsMagnetic = true;

            switch (mineSize)
            {
                case Entities.MineSize.Large:
                    Points = 500;
                    break;
                case Entities.MineSize.Medium:
                    Points = 535;
                    break;
                case Entities.MineSize.Small:
                    Points = 600;
                    break;
            }
        }

        protected override void InitializeVectors()
        {
            var verticies = new VertexPositionColor[8];
            verticies[0] = new VertexPositionColor(new Vector3(-4, 4, 0), Constants.VectorColor);
            verticies[1] = new VertexPositionColor(new Vector3(0, 1.5f, 0), Constants.VectorColor);
            verticies[2] = new VertexPositionColor(new Vector3(4, 4, 0), Constants.VectorColor);
            verticies[3] = new VertexPositionColor(new Vector3(1.5f, 0, 0), Constants.VectorColor);
            verticies[4] = new VertexPositionColor(new Vector3(4, -4, 0), Constants.VectorColor);
            verticies[5] = new VertexPositionColor(new Vector3(0, -1.5f, 0), Constants.VectorColor);
            verticies[6] = new VertexPositionColor(new Vector3(-4, -4, 0), Constants.VectorColor);
            verticies[7] = new VertexPositionColor(new Vector3(-1.5f, 0, 0), Constants.VectorColor);

            SetVerticies(verticies);

            SetIndicies("mine", true, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 0);
        }

        protected override int ShellLineCount
        {
            get { return 8; }
        }
    }
}
